Test-Series - programming logic

Test Number 8/15

Q: In data structure, data may be of __ types.
A. 3
B. 2
C. 1
D. 4
Solution: The correct answer is:
2
Q: In order to create a local variable we need to use local keyword.

local int var;
A. true
B. false
C. partially true
D. partially false
Solution: false
Q: Data is nothing but ____________.
A. Programming Statement
B. None of these
C. Bunch of Information
D. Piece of Information
Solution: The correct answer is:
Piece of Information
Q: While calculating time complexity of an algorithm, the designer concerns himself/herself primarily with the run time and not the compile time. Why?
A. Compile time is always more than run time.
B. Compile time is a function of run time.
C. A program needs to be compiled once but can be run several times
D. Run time is always more than compile time.
Solution: The correct answer is:
A program needs to be compiled once but can be run several times
Q: The memory space needed by an algorithm has a fixed part independent of the problem instance solved and a variable part that changes according to the problem instance solved. In general, which of these two is of prime concern to an algorithm designer?
A. Variable Part
B. None of these
C. Fixed part
D. Product of fixed part and variable part
Solution: The correct answer is:
Variable Part
Q: What will be the output of the following code?

//assume all header files are included

void main()
{
int x=97;
int y=sizeof(X++);
printf("x is %d", x);
}
A. X is 99
B. X is 97
C. Run time error
D. X is 98
Solution: The correct answer is:
X is 97
Q: What is space complexity of a program?
A. Amount of memory required by the program to run
B. Amount of hard-disk space required to compile the program
C. Amount of hard-disk space required to store the program
D.  Amount of memory required for the program to compile
Solution: The correct answer is:
Amount of memory required by the program to run
Q: There is an array of size n initialized with 0. Akanksha has to write a code which inserts the value 3k at position 3k in the array, where k=0,1…(till possible). Akanksha writes an efficient code to do so. What is the time complexity of her code?
A. &theta(n^2)
B. &theta(log3(n))
C. &theta(n)
D. &theta(3n)
Solution: The correct answer is:
&theta(log3(n))
Q: Saumya writes a code which has a function which calls itself. Which programming concept is Saumya using?
A. Recursion
B. Decision Making
C. Overloading
D. This is bad programming practice and should not be done.
Solution: The correct answer is:
Recursion
Q: Atomic Data is also called as _____________.
A. Textual Data
B. None of these
C. Scalar Data
D. Dynamic Data
Solution: The correct answer is:
Dynamic Data

You Have Score    /10